package com.pretty.test.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pretty.test.controller.pets.baikeanimaltype.vo.BaikeAnimalTypeListVO;
import com.pretty.test.controller.pets.baikeanimaltype.wrapper.BaikeAnimalTypeListWrapper;
import com.pretty.test.entity.PetsBaikeAnimalType;
import com.pretty.test.mapper.PetsBaikeAnimalTypeMapper;
import com.pretty.test.service.IPetsBaikeAnimalTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 百科动物种类服务实现类
 * @author dujianyu
 * @since 2021-04-13
 */
@Service
public class PetsBaikeAnimalTypeServiceImpl extends ServiceImpl<PetsBaikeAnimalTypeMapper, PetsBaikeAnimalType> implements IPetsBaikeAnimalTypeService {

    @Override
    public List<BaikeAnimalTypeListVO> selectBaikeAnimalTypeList() {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("is_deleted",0);
        queryWrapper.orderByAsc("sort");
        return BaikeAnimalTypeListWrapper.build().listVO(baseMapper.selectList(queryWrapper));
    }
}
